package com.example.wangzh.developkit.control.main;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import androidx.appcompat.widget.Toolbar;

import com.example.wangzh.developkit.R;
import com.example.wangzh.developkit.base.BaseActivity;
import com.example.wangzh.developkit.control.AmountSelectorActivity;
import com.example.wangzh.developkit.control.CountDownListActivity;
import com.example.wangzh.developkit.control.CountDownManagerActivity;
import com.example.wangzh.developkit.control.DragerHelperActivity;
import com.example.wangzh.developkit.control.IndexableListActivity;
import com.example.wangzh.developkit.control.KeyBoardActivity;
import com.example.wangzh.developkit.control.LogTestActivity;
import com.example.wangzh.developkit.control.LoginActivity;
import com.example.wangzh.developkit.control.PasswordActivity;
import com.example.wangzh.developkit.control.PopupWindowActivity;
import com.example.wangzh.developkit.control.RateActivity;
import com.example.wangzh.developkit.control.RcvTestActivity;
import com.example.wangzh.developkit.control.SelectListActivity;
import com.example.wangzh.developkit.control.ShowPicActivity;
import com.example.wangzh.developkit.control.SignViewActivity;
import com.example.wangzh.developkit.control.SwipeActivity;
import com.example.wangzh.developkit.control.TextViewParaAnalyzeActivity;
import com.example.wangzh.developkit.control.WheelPickerActivity;
import com.example.wangzh.developkit.control.hover.HoverActivity;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * Created by wangzh on 2017/10/19.
 */

public class MainActivity extends BaseActivity {
    @BindView(R.id.lsv)
    ListView lsv;
    @BindView(R.id.toolBar)
    Toolbar toolbar;

    List<String> strs;

    @Override
    protected int getLayout() {
        return R.layout.activity_main;
    }

    @Override
    protected void initView() {
        setSupportActionBar(toolbar);
        strs = new ArrayList<>();
        strs.add("TextView参数分析");
        strs.add("RecyclerView测试");
        strs.add("悬浮球");
        strs.add("数量选择");
        strs.add("列表倒计时");
        strs.add("字母索引列表");
        strs.add("密码输入");
        strs.add("星级评价,智能换行标签");
        strs.add("下拉刷新，侧拉删除");
        strs.add("展示图片");
        strs.add("滚轮");
        strs.add("登录");
        strs.add("列表选择");
        strs.add("倒计时工具，可重设参数，重新开始计时");
        strs.add("签名控件");
        strs.add("自定义软键盘");
        strs.add("DragHelper");
        strs.add("BasePopupWindow");
        strs.add("Log测试");
        lsv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strs));
        lsv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                Intent intent;
                switch (strs.get(position)) {
                    case "悬浮球":
                        intent = new Intent(MainActivity.this, HoverActivity.class);
                        startActivity(intent);
                        break;
                    case "数量选择":
                        intent = new Intent(MainActivity.this, AmountSelectorActivity.class);
                        startActivity(intent);
                        break;
                    case "列表倒计时":
                        intent = new Intent(MainActivity.this, CountDownListActivity.class);
                        startActivity(intent);
                        break;
                    case "字母索引列表":
                        intent = new Intent(MainActivity.this, IndexableListActivity.class);
                        startActivity(intent);
                        break;
                    case "密码输入":
                        intent = new Intent(MainActivity.this, PasswordActivity.class);
                        startActivity(intent);
                        break;
                    case "星级评价,智能换行标签":
                        intent = new Intent(MainActivity.this, RateActivity.class);
                        startActivity(intent);
                        break;
                    case "下拉刷新，侧拉删除":
                        intent = new Intent(MainActivity.this, SwipeActivity.class);
                        startActivity(intent);
                        break;
                    case "展示图片":
                        intent = new Intent(MainActivity.this, ShowPicActivity.class);
                        startActivity(intent);
                        break;
                    case "滚轮":
                        intent = new Intent(MainActivity.this, WheelPickerActivity.class);
                        startActivity(intent);
                        break;
                    case "登录":
                        intent = new Intent(MainActivity.this, LoginActivity.class);
                        startActivity(intent);
                        break;
                    case "列表选择":
                        intent = new Intent(MainActivity.this, SelectListActivity.class);
                        startActivity(intent);
                        break;
                    case "倒计时工具，可重设参数，重新开始计时":
                        intent = new Intent(MainActivity.this, CountDownManagerActivity.class);
                        startActivity(intent);
                        break;
                    case "签名控件":
                        intent = new Intent(MainActivity.this, SignViewActivity.class);
                        startActivity(intent);
                        break;
                    case "自定义软键盘":
                        intent = new Intent(MainActivity.this, KeyBoardActivity.class);
                        startActivity(intent);
                        break;
                    case "DragHelper":
                        intent = new Intent(MainActivity.this, DragerHelperActivity.class);
                        startActivity(intent);
                        break;
                    case "BasePopupWindow":
                        intent = new Intent(MainActivity.this, PopupWindowActivity.class);
                        startActivity(intent);
                        break;
                    case "Log测试":
                        intent = new Intent(MainActivity.this, LogTestActivity.class);
                        startActivity(intent);
                        break;
                    case "RecyclerView测试":
                        intent = new Intent(MainActivity.this, RcvTestActivity.class);
                        startActivity(intent);
                        break;
                    case "TextView参数分析":
                        intent = new Intent(MainActivity.this, TextViewParaAnalyzeActivity.class);
                        startActivity(intent);
                        break;
                    default:
                        break;
                }
            }
        });
    }

}
